package com.lee.lease.web.admin.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lee.lease.model.entity.SystemPost;
import com.lee.lease.model.entity.SystemUser;
import com.lee.lease.web.admin.mapper.SystemPostMapper;
import com.lee.lease.web.admin.mapper.SystemUserMapper;
import com.lee.lease.web.admin.service.SystemPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author liubo
* @description 针对表【system_post(岗位信息表)】的数据库操作Service实现
* @createDate 2023-07-24 15:48:00
*/
@Service
public class SystemPostServiceImpl extends ServiceImpl<SystemPostMapper, SystemPost>
    implements SystemPostService {
    @Autowired
    private SystemPostMapper systemPostMapper;
    @Autowired
    private SystemUserMapper systemUserMapper;

    @Override
    public Integer removeByPostId(Long id) {
        systemPostMapper.deleteById(id);
        LambdaQueryWrapper<SystemUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SystemUser::getPostId, id);
        systemUserMapper.delete(queryWrapper);
        return null;
    }
}




